<%@ Control Language="C#" AutoEventWireup="true" CodeFile="GroupPermission.ascx.cs" Inherits="Webadmin_Modules_User_GroupPermission" %>
<%@ Import Namespace="System.Data" %>
<script language="javascript" type="text/javascript">
function check_permission()
{
    if(confirm('<%=_AdminLang["UserGroup_PermissionQuestion"] %>')) return true;
    return false;
}
</script>
 <form id="frmMain" runat="server" method="post" enctype="multipart/form-data" onsubmit="return check_permission();" >
        <div align="center">
            <table width="90%" border="0" cellpadding="0" cellspacing="0" class="box_main">  
              <tr>
                <td width="100%" height="30" valign="top" class="navigator" align="left">&nbsp;<%=_Navigator %></td>
              </tr>
              <tr>
                <td valign="top" align="center">
		            <table class="box_into" width="98%" border="0" cellpadding="5" cellspacing="0">		            
		            <tr>
		  	            <td colspan="2" class="input_label" align="right" style="width: 34%">&nbsp;</td>
		  	            
		            </tr>
		            <%foreach (DataRow dr in _dt.Rows)
                {
                    if (dr["GroupName"].ToString().Contains("User")) continue; 
                    DataTable dt = this.getFunction(dr["GroupName"].ToString());
                    %>
		             <tr>
		  	            <td colspan="2"  class="input_label" align="left" style="width: 27%;background:#dedede;text-align:left;text-transform:uppercase">&nbsp;<%=_AdminLang[dr["GroupName"].ToString()]%></td>
		  	            
		            </tr>	
		            <%foreach (DataRow drIn in dt.Rows)
                {
                    DataTable dttmp = AFG.getRecord(drIn["FunctionName"].ToString(), _ID);
                    string level = dttmp.Rows.Count <= 0 ? "0" : dttmp.Rows[0]["FunctionLevel"].ToString(); %>
		            <tr>
		  	            <td  class="input_label" align="right" style="width: 27%">&nbsp;<%=_AdminLang[drIn["FunctionName"].ToString()]%></td>
		  	            <td  class="input_textbox" width="60%" align="left">
		  	            <input type="hidden" name="txtFunctionName" value="<%=drIn["FunctionName"] %>" id="txtFunctionName" />
		  	            <select name="selLevel" id="selLevel">
		  	            <option value="0"><%=_AdminLang["UserGroup_PermissionBlock"] %></option>
		  	            <option value="<%=bzCheckAdminUser.View %>" <%=bzCheckAdminUser.View.ToString()==level?"Selected":"" %>><%=_AdminLang["UserGroup_PermissionView"] %></option>
		  	            <option value="<%=bzCheckAdminUser.Type %>" <%=bzCheckAdminUser.Type.ToString()==level?"Selected":"" %>><%=_AdminLang["UserGroup_PermissionType"] %></option>
		  	            <option value="<%=bzCheckAdminUser.Edit %>" <%=bzCheckAdminUser.Edit.ToString()==level?"Selected":"" %>><%=_AdminLang["UserGroup_PermissionEdit"] %></option>
		  	            <option value="<%=bzCheckAdminUser.Delete %>" <%=bzCheckAdminUser.Delete.ToString()==level?"Selected":"" %>><%=_AdminLang["UserGroup_PermissionDelete"] %></option>
		  	            </select>
		  	            </td>
		            </tr>              	            
		             <%}
             } %>
		              
		  		        <tr>
		  	                <td colspan="2" style="width: 77px; height: 10px;">&nbsp;</td>
		                </tr>	
		            </table>
                </td>
              </tr>
               <tr>
			            <td  height="22" valign="top" colspan="2" align="center">
			                <asp:Button ID="btnUpdate" Text="" runat="server" CssClass="btn_submit" OnClick="btnUpdate_Click"  />
			                <div class="back" style="float:right;margin-right:10px"><a href="<%=Session["Page"]%>"><%=_AdminLang["Back"] %></a></div>
			            </td>			
		              </tr>
              <tr>
  	            <td style="height: 19px">&nbsp;</td>
              </tr>
            </table>
          </div>         
       </form>    